package collection;

import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;

public class ListIteratorDemo {
    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);
        ListIterator<Integer> it = list.listIterator();
        System.out.println(it.next());
        System.out.println(it.next());
//        System.out.println(it.nextIndex());
        System.out.println(it.previous());
        System.out.println(it.previous());
//        System.out.println(it.previousIndex());
    }
}
